Component({
    options: {
        addGlobalClass: true
    },
    properties: {
        extClass: {
            type: String,
            value: ''
        },
        current: {
            type: Number,
            value: 0
        }
    },
    data: {
        isIphoneX: ''
    },
    methods: {
        tabChange: function tabChange(e) {
            var index = e.currentTarget.dataset.index;
            console.log(index)
            if (index === this.data.current) {
                return;
            }
            this.setData({
                current: index
            });
            this.triggerEvent('change', { index: index, item: this.data.list[index] });
            console.log(this.data.list[index])
        },
    },
    lifetimes: {
        attached() {
            let that = this
            // wx.getSystemInfo({
            //     success: (res) => {
            //         let modelmes = res.model;
            //         let iphoneArr = ['iPhone X', 'iPhone 11', 'iPhone 11 Pro Max']
            //         iphoneArr.forEach(function (item) {
            //             if (modelmes.search(item) != -1) {
            //                 that.setData({
            //                     isIphoneX: true
            //                 })
            //             }
            //         })
            //     }
            // })
        }
    }
});